openarenafandomcom-20200216-history
Map rotation script
A map rotation script is a series of commands which server admins pre-configure to have the game cycle between different maps automatically. Map change happens after match end or in case players vote for nextmap (or in case server admin enters /vstr nextmap command). Map rotation scripts are supported since the original Q3A, and should work with most mods. How-to A map rotation script is done with a series of user-generated cvars (variables), and each one contains a few commands: each one loads a map and then sets the "nextmap" variable telling it has to "run" another user-generated cvar next. The last one sets the first one as next. Then there is a commad with "runs" the first one, starting the loop. You usually write down those user generated variables in a cfg file, then you "exec" it, and the rotation starts. A classic rotation script is structured as follows: set "map ; set nextmap vstr " set "map ; set nextmap vstr " ... set "map ; set nextmap vstr " vstr Let's translate into an example with real maps: // Map rotation script set m1 "map aggressor; set nextmap vstr m2" set m2 "map oa_dm1; set nextmap vstr m3" set m3 "map wrackdm17; set nextmap vstr m1" vstr m1 // start loop at m1 This would play aggressor then oa_dm1 then wrackdm17, then wrackdm17, then aggressor, then oa_dm1 and so on... "Vstr" is the command which "executes" a cvar like its content was typed directly in command console. "m1", "m2", "m3" are the names of the user-generated cvars we are using: you can name them as you wish (a1, a2, a3... loop1, loop2, loop3, etc.), as long as you don't use the names of existing variables or commands. The quotes mark the beginning and the end of the content of each cvar. You may type the script directly in console... but the most common behavior is to prepare the rotation script externally, using a text editor to create a plain text file to be placed under your baseoa (or current mod) folder (e.g. myrotation.cfg), then start OpenArena (full game or dedicated server binaries) and use the command console to run the configuration file which contains the rotation script, such as /exec myrotation or /exec myrotation.cfg Keep in mind * IMPORTANT: be aware that changing gametype seems to completely break map rotation scripts (requiring server admin to manually start the script again!). It looks like it is this way since the original Q3A. Hence, you may consider to do not allow voting for gametype (through editing g_votenames variable), or to use g_autonextmap (random map change) instead. * Callvoting for a different map, even not included in the rotation script, does not seem to be a problem: when the match on the player-selected map will end (or if they will callvote for nextmap), the rotation script should resume normally. ** Changing map directly (the server admin typing the "map" command in console), instead, breaks the map rotation script as it sets nextmap to map_restart 0. * Each map rotation script follows a pre-defined cycle. You can of course prepare different .cfg files to fit different needs and exec them when needed. * To give some more variation to the players, you may prepare different rotation scripts in different configuration files, then set up custom votes to allow players to vote for running a script or another one (e.g. a vote for "small maps rotation" and one for "large maps rotation"), with each custom vote option doing a different "exec " command. Custom votes are allowed since OA 0.8.5 gamecode (they are not supported by older mods). * If you want your rotation to be stared as soon as you open the game, you may place it into a file named autoexec.cfg. * It is possible to use "auto change map" feature (g_autonextmap) as an alternative to map rotation scripts. In that case, the next map will be picked up randomly instead of following a fixed cycle (you can customize the "mappools" by editing apposite lists to decide which maps will be available). This feature is supported since OA 0.8.8 gamecode (it's not supported by older mods). ** In order to have classic map rotation scripts working as expected, you need to have g_autonextmap disabled (set to 0). * As it looks like in Tournament (1v1) mode there is no "match ending", using/callvoting "nextmap" may be the only way to proceed to the next step of the loop. The same may apply to other gametypes in case no timelimit and fraglimit/capturelimit are set. * nextmap is an important cvar. Server admin can "execute" its content with /vstr nextmap, and the game will do it automatically after match end. In case you don't change its content with the map rotation script, the game will usually set its value to "map_restart 0" (0 are the seconds before map restart, meaning the map will be restarted immediately if you do vstr nextmap). **Pay attention, in case you incorrectly set nextmap variable (e.g. set it empty), the game would not start a new match after the end of the current one! Typing "/reset nextmap" would make it empty! Manually loading a map with "/map " command will set nextmap to "map_restart 0". See also * G_autonextmap * Configuration examples * Manual/Multiplayer ** Manual/Multiplayer/Advanced * Servers * Command console Category:Servers Category:Manual